

--select DON_VI_ID, [CHI_TIEU_ID]
--from [NV].[KEHOACH] kh
--where kh.[NAM_KE_HOACH_ID] =2016 and CHI_TIEU_ID in 
--(SELECT CHI_TIEU_ID from [NV].[DONVI_CHITIEU]
--					where [NAM_KE_HOACH_ID] = 2016 and DON_VI_ID = 39 and FLAG = 1)

SELECT DON_VI_ID, [CHI_TIEU_ID]
	FROM [NV].[DONVI_CHITIEU]
	where [NAM_KE_HOACH_ID]  = 2016 and [FLAG] = 0 and
	[DON_VI_ID] in (Select [DON_VI_ID] from [DM].[DONVI] 
		where [CO_QUYEN_GIAM_SAT] = 0 or [CO_QUYEN_GIAM_SAT] = 2)
	and  [CHI_TIEU_ID] in (select [CHI_TIEU_ID] from [NV].[DONVI_CHITIEU]
	 where [NAM_KE_HOACH_ID] = 2016 and [DON_VI_ID]  = 43 and FLAG = 1)
		order by DON_VI_ID